package nav

/*
#include<stdint.h>
#include<stdbool.h>
extern void nav_dtProximityGrid_addItem(void * c_this,unsigned short id,float minx,float miny,float maxx,float maxy);
extern void nav_dtProximityGrid_clear(void * c_this);
extern void nav_dtProximityGrid_Delete(void * c_this);
extern void nav_dtProximityGrid_DeleteArray(void * c_this);
extern void* nav_NewdtProximityGrid();
extern void * nav_dtProximityGrid_getBounds(void * c_this);
extern float nav_dtProximityGrid_getCellSize(void * c_this);
extern int nav_dtProximityGrid_getItemCountAt(void * c_this,int x,int y);
extern void * nav_dtProximityGrid_IndexArray(void * c_this,long n);
extern bool nav_dtProximityGrid_init(void * c_this,int poolSize,float cellSize);
extern int nav_dtProximityGrid_queryItems(void * c_this,float minx,float miny,float maxx,float maxy,void * ids,int maxIds);
extern void * nav_dtAllocProximityGrid();
extern void nav_dtFreeProximityGrid(void * ptr);
extern void * nav_NewDtProximityGridPtrArray(long n);

*/
import "C"
import "unsafe"
import "gitee.com/hasika/cgo"

var _ unsafe.Pointer
var _ cgo.NotUsed

type DtProximityGridPtr uintptr

/*
public void addItem(unsigned short const id, float const minx, float const miny, float const maxx, float const maxy)
*/
func (p DtProximityGridPtr) AddItem(id uint16, minx float32, miny float32, maxx float32, maxy float32) {
	var wrap_this unsafe.Pointer
	var wrap_arg_id C.ushort
	var wrap_arg_minx C.float
	var wrap_arg_miny C.float
	var wrap_arg_maxx C.float
	var wrap_arg_maxy C.float
	wrap_this = unsafe.Pointer(p)
	wrap_arg_id = (C.ushort)(id)
	wrap_arg_minx = (C.float)(minx)
	wrap_arg_miny = (C.float)(miny)
	wrap_arg_maxx = (C.float)(maxx)
	wrap_arg_maxy = (C.float)(maxy)
	C.nav_dtProximityGrid_addItem(wrap_this, wrap_arg_id, wrap_arg_minx, wrap_arg_miny, wrap_arg_maxx, wrap_arg_maxy)
}

/*
public void clear()
*/
func (p DtProximityGridPtr) Clear() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtProximityGrid_clear(wrap_this)
}

/*
public void Delete()
*/
func (p DtProximityGridPtr) Delete() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtProximityGrid_Delete(wrap_this)
}

/*
void DeleteArray()
*/
func (p DtProximityGridPtr) DeleteArray() {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	C.nav_dtProximityGrid_DeleteArray(wrap_this)
}

/*
public dtProximityGrid()
*/
func NewDtProximityGrid() cgo.GoManagedPtr[DtProximityGridPtr] {
	wrap_out := C.nav_NewdtProximityGrid()
	go_out := cgo.MakePtr[cgo.GoManagedPtr[DtProximityGridPtr]](uintptr(wrap_out))
	return go_out
}

/*
public int const * getBounds() const
*/
func (p DtProximityGridPtr) GetBounds() *int32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtProximityGrid_getBounds(wrap_this)
	go_out := (*int32)(unsafe.Pointer(wrap_out))
	return go_out
}

/*
public float getCellSize() const
*/
func (p DtProximityGridPtr) GetCellSize() float32 {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtProximityGrid_getCellSize(wrap_this)
	go_out := float32(wrap_out)
	return go_out
}

/*
public int getItemCountAt(int const x, int const y) const
*/
func (p DtProximityGridPtr) GetItemCountAt(x int32, y int32) int32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_x C.int
	var wrap_arg_y C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_x = (C.int)(x)
	wrap_arg_y = (C.int)(y)
	wrap_out := C.nav_dtProximityGrid_getItemCountAt(wrap_this, wrap_arg_x, wrap_arg_y)
	go_out := int32(wrap_out)
	return go_out
}

/*
dtProximityGrid * IndexArray(long n)
*/
func (p DtProximityGridPtr) IndexArray(n int) uintptr {
	var wrap_this unsafe.Pointer
	wrap_this = unsafe.Pointer(p)
	wrap_out := C.nav_dtProximityGrid_IndexArray(wrap_this, C.long(n))
	go_out := uintptr(wrap_out)
	return go_out
}

/*
public bool init(int const poolSize, float const cellSize)
*/
func (p DtProximityGridPtr) Init(poolSize int32, cellSize float32) bool {
	var wrap_this unsafe.Pointer
	var wrap_arg_poolSize C.int
	var wrap_arg_cellSize C.float
	wrap_this = unsafe.Pointer(p)
	wrap_arg_poolSize = (C.int)(poolSize)
	wrap_arg_cellSize = (C.float)(cellSize)
	wrap_out := C.nav_dtProximityGrid_init(wrap_this, wrap_arg_poolSize, wrap_arg_cellSize)
	go_out := bool(wrap_out)
	return go_out
}

/*
public int queryItems(float const minx, float const miny, float const maxx, float const maxy, unsigned short * ids, int const maxIds) const
*/
func (p DtProximityGridPtr) QueryItems(minx float32, miny float32, maxx float32, maxy float32, ids *uint16, maxIds int32) int32 {
	var wrap_this unsafe.Pointer
	var wrap_arg_minx C.float
	var wrap_arg_miny C.float
	var wrap_arg_maxx C.float
	var wrap_arg_maxy C.float
	var wrap_arg_ids unsafe.Pointer
	var wrap_arg_maxIds C.int
	wrap_this = unsafe.Pointer(p)
	wrap_arg_minx = (C.float)(minx)
	wrap_arg_miny = (C.float)(miny)
	wrap_arg_maxx = (C.float)(maxx)
	wrap_arg_maxy = (C.float)(maxy)
	wrap_arg_ids = (unsafe.Pointer)(ids)
	wrap_arg_maxIds = (C.int)(maxIds)
	wrap_out := C.nav_dtProximityGrid_queryItems(wrap_this, wrap_arg_minx, wrap_arg_miny, wrap_arg_maxx, wrap_arg_maxy, wrap_arg_ids, wrap_arg_maxIds)
	go_out := int32(wrap_out)
	return go_out
}

/*
dtProximityGrid * dtAllocProximityGrid()
*/
func DtAllocProximityGrid() DtProximityGridPtr {
	wrap_out := C.nav_dtAllocProximityGrid()
	go_out := cgo.MakePtr[DtProximityGridPtr](uintptr(wrap_out))
	return go_out
}

/*
void dtFreeProximityGrid(dtProximityGrid * ptr)
*/
func DtFreeProximityGrid(ptr DtProximityGridPtr) {
	var wrap_arg_ptr unsafe.Pointer
	wrap_arg_ptr = (unsafe.Pointer)(ptr)
	C.nav_dtFreeProximityGrid(wrap_arg_ptr)
}

/*
dtProximityGrid * NewDtProximityGridPtrArray(long n)
*/
func NewDtProximityGridPtrArray(n int) cgo.GoManagedPtr[cgo.Array[DtProximityGridPtr]] {
	wrap_out := C.nav_NewDtProximityGridPtrArray(C.long(n))
	go_out := cgo.MakePtr[cgo.GoManagedPtr[cgo.Array[DtProximityGridPtr]]](uintptr(wrap_out))
	return go_out
}
